import { defineStore } from 'pinia'
import { getMenuRoutes } from '@/api/menu'

export const useMenuStore = defineStore('menu', {
  state: () => ({
    menuList: [] as any[]
  }),
  actions: {
    async fetchMenu() {
      const res = await getMenuRoutes()
      this.menuList = res.data?.data || res.data || []
    }
  }
})
